<breadcrumbs></breadcrumbs>

<div class="content-container">
    <form name="addEditRepositoryForm" novalidate="novalidate">

        <label for="code"><message key="gen.code.title"></message></label>
        <div class="form-control-group" ng-class="deriveFormControlsContainerClasses('code')">
            <div ng-show="amEditing" class="form-control-group-static">
                <code>{{workingRepository.code}}</code>
            </div>
            <input
                    id="code"
                    type="text"
                    name="code"
                    autocomplete="off"
                    ng-show="!amEditing"
                    ng-change="codeChanged()"
                    ng-required="true"
                    ng-pattern="/^[a-z0-9]{2,16}$/"
                    ng-model="workingRepository.code"></input>
            <error-messages key-prefix="addEditRepository.code" error="addEditRepositoryForm.code.$error"></error-messages>
        </div>

        <label for="code"><message key="gen.architecture.title"></message></label>
        <div class="form-control-group">
            <div ng-show="amEditing" class="form-control-group-static">
                <code>{{workingRepository.architecture.code}}</code>
            </div>
            <select
                    ng-show="!amEditing"
                    ng-model="workingRepository.architecture"
                    ng-options="anArchitecture.code for anArchitecture in architectures">
            </select>
        </div>

        <label for="url"><message key="addEditRepository.url.title"></message></label>
        <div class="form-control-group" ng-class="deriveFormControlsContainerClasses('url')">
            <input
                    id="url"
                    type="text"
                    size="64"
                    name="url"
                    autocomplete="off"
                    ng-change="urlChanged()"
                    ng-required="true"
                    ng-model="workingRepository.url"></input>
            <error-messages key-prefix="addEditRepository.url" error="addEditRepositoryForm.url.$error"></error-messages>
        </div>

        <div class="form-action-container">
            <button
                    ng-disabled="addEditRepositoryForm.$invalid"
                    ng-click="goSave()"
                    type="submit"
                    class="main-action">
                <span ng-show="amEditing"><message key="addEditRepository.saveChangesAction.title"></message></span>
                <span ng-show="!amEditing"><message key="addEditRepository.addAction.title"></message></span>
            </button>
        </div>

    </form>
</div>

<div class="footer"></div>
<spinner spin="shouldSpin()"></spinner>

